package com.example.administrator.bmob;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.EditText;

import cn.bmob.v3.Bmob;
import cn.bmob.v3.exception.BmobException;
import cn.bmob.v3.listener.SaveListener;

public class MainActivity extends AppCompatActivity {
    private EditText mName,mFeedBack;
    private static final String TAG = "MainActivity";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Bmob.initialize(this,"0821eb64331e6b70b94a51079230b753");
    }
    public void onClick(View view) {
        switch (view.getId()){
            case R.id.button:
        mName = (EditText) findViewById(R.id.name);
        mFeedBack = (EditText) findViewById(R.id.feedback);
                String name = mName.getText().toString();
                String feedback = mFeedBack.getText().toString();
                FeedBack feed01=new FeedBack();
                feed01.setName(name);
                feed01.setFeedback(feedback);
                feed01.save(new SaveListener<String>() {
                    @Override
                    public void done(String s, BmobException e) {
                        Log.d(TAG, "done: ");

                    }
                });
        }}}

